package com.lhf.aicloud.config;

import com.fasterxml.jackson.databind.node.ArrayNode;
import com.lhf.aicloud.utils.idempotent.IdempotentInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: lhf
 * @date: Created in 2024/08/16
 * @description:
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private IdempotentInterceptor idempotentInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(idempotentInterceptor)
                // 拦截所有请求
                .addPathPatterns("/**");
    }
}
